﻿using System.Windows;
using RG.Common.Export;
using Microsoft.Windows.Controls;

namespace RG.Common.WPF.Controls.ColumnInfoDataGrid
{
    public static class ColumnInfoAttachedProperty
    {

        public static readonly DependencyProperty ColumnInfoProperty = DependencyProperty.RegisterAttached(
             "ColumnInfo", typeof(IColumnInfo), typeof(DataGridColumn), new FrameworkPropertyMetadata(null));

        public static void SetColumnInfo(DataGridColumn column, IColumnInfo value)
        {
            column.SetValue(ColumnInfoProperty, value);
        }

        public static IColumnInfo GetColumnInfo(DataGridColumn grid)
        {
            return (IColumnInfo)grid.GetValue(ColumnInfoProperty);
        }
    }
}
